/**********************************************************************
 Name:  TestSynCoordinateConsumerEdu,测试用例
 Purpose: 测试做妈妈班拜访把对应的开始时间和坐标同步到callplan                                                         
-------                                                             
======================================================
History                                                            
-------                                                            
VERSION  AUTHOR               DATE                 DETAIL                                
   1.0 -      huang xiaojiang      04/29/2010      Create          : 
***********************************************************************/
@isTest
private class TestSynCoordinateConsumerEdu{
   
    static testMethod void test(){
           Profile p=[select  id from profile where  name='Sales Rep - Medical' limit 1];
           User u=new user(alias='hxj',email='xjhuanw3ww7@isoftstone.com',lastName='testing'
               ,languageLocaleKey='zh_CN',localeSidkey='zh_CN' ,TimeZoneSidKey='Asia/Shanghai',EmailEncodingKey='UTF-8',
               profileId=p.id,userName='xjhuang4123@isoftstone.com');
               
               System.runAs(u){
                    
                    //妈妈班记录类型
                      
                    list<recordtype> lstRT=new list<recordtype>();
                    id IdKNH;
                    lstRT=[select id,DeveloperName from recordtype where sobjecttype=:'ConsumerEducation__c' and DeveloperName=:'p_class'];
                    if(lstRT.size()>0){
                        IdKNH=lstRT[0].id;
                    }
                   hospital__c hp=new hospital__c(name='testhospital',Nickname__c='testnick', approvalstatus__c='审批通过',active__c=true);
                   insert hp;
                                       
                   //新建一条妈妈班信息                   
                   ConsumerEducation__c consumerEdu=new ConsumerEducation__c(name='testsaloon',recordtypeid=IdKNH,
                        Date__c=date.today(),time__c='PM',HCP_NEW__c='22',Type__c='PClass'
                       ,messaging__c='安婴儿A＋早产儿配方 满足低出生体重儿营养所需，营养组合满足多项权威推荐。含临床验证水平DHA和ARA，帮助智力和视力发育。'
                        ,invitedno__c=1.0,venue__c='海外',organizer__c='医院',ifnonhospital__c=' d'
                        ,OrganigerHospital__c=hp.id
                        );             //create a saloon type record;
                   insert consumerEdu;   
                   //更新这条妈妈班信息
                   consumerEdu.lat__c='111.22222';
                   consumerEdu.lon__c='33.999';
                   consumerEdu.StartTime__c=dateTime.now();
                   
                   update consumerEdu;
                                     
               }        
    }
 }